package com.freestyle.nettychat.boot;

import com.freestyle.nettychat.server.NettyChatServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;

import javax.annotation.Resource;


/**
 * Created by rocklee on 2022/2/2 22:27
 */
@EnableCaching
@EnableAsync
@SpringBootApplication(scanBasePackages = {"com.freestyle.redis","com.freestyle.nettychat"})
public class ChatServerApplication {
  public static void main(String[] args){
    //new ApplicationKeeper(SpringApplication.run(ChatServerApplication.class, args)).keep();
    ConfigurableApplicationContext context= SpringApplication.run(ChatServerApplication.class, args);
    NettyChatServer server=context.getBean(NettyChatServer.class);
    server.await();
  }
}
